//
//  OAuth.h
//
//  Created by Jaanus Kase on 12.01.10.
//  Copyright 2010. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "OAConsumer.h"

@class WeiboConnection;

@interface OAuth : NSObject {
    // my app credentials
    OAConsumer *_consumer;
    NSMutableDictionary *_basicOAuthDic;
}
@property (nonatomic,retain) OAConsumer *consumer;
@property (nonatomic,readonly) NSDictionary *basicOAuthParam;

// Internal methods, no need to call these directly from outside.
- (NSString *) oAuthHeaderForMethod:(NSString *)method 
                             andUrl:(NSString *)url 
                          andParams:(NSDictionary *)params
					 andTokenSecret:(NSString *)token_secret;

- (NSString *) oAuthSignatureForMethod:(NSString *)method 
                             andUrl:(NSString *)url 
                          andParams:(NSDictionary *)params
					 andTokenSecret:(NSString *)token_secret;

- (NSString *) oauth_signature_base:(NSString *)httpMethod 
                            withUrl:(NSString *)url 
                          andParams:(NSDictionary *)params;

- (NSString *) oauth_authorization_header:(NSString *)oauth_signature 
                               withParams:(NSDictionary *)params;

- (NSString *) sha1:(NSString *)str;
@end

